// JavaScript Document

//地图漫游
function map_init(){
	mapObj.removeAllOverlays();
	mapObj.setCurrentMouseTool(PAN_WHEELZOOM);
}

//拉框放大
function FrameZoomIN(){
	mapObj.removeAllOverlays();
	mapObj.setCurrentMouseTool(FRAME_ZOOMIN);
}

//拉框缩小
function FrameZoomOUT(selecttypewords){
	mapObj.removeAllOverlays();
	mapObj.setCurrentMouseTool(FRAME_ZOOMOUT)
}

//测量距离
function Ruler(){
	mapObj.removeAllOverlays();
	mapObj.setCurrentMouseTool(RULER)
}

//鼠标测面
function Compute_area(){
	mapObj.removeAllOverlays();
	mapObj.setCurrentMouseTool(COMPUTE_AREA)
}


//图层叠加
function ControlLayer(){
	var temp = '<input type="submit" name="button" class="btnbg" style="width:135px;" value="添加实时交通层" onClick="addTileLayer_TRAFFIC()"><input type="submit" name="button" class="btnbg" style="width:135px;" value="删除实时交通层" onClick="mapObj.removeTileLayer(TL_TRAFFIC);"><br><input type="submit" name="button" class="btnbg" style="width:135px;" value="添加轨道交通层" onClick="addTileLayer_MASS_TRANSIT()"><input type="submit" name="button" class="btnbg" style="width:135px;" value="删除轨道交通层" onClick="mapObj.removeTileLayer(TL_MASS_TRANSIT);">';
	showMapMenu(temp);
}

function addTileLayer_TRAFFIC(){
	var tl = new MTileLayer(TL_TRAFFIC);  //添加实时交通层
	mapObj.addTileLayer(tl);//添加层
}

function addTileLayer_MASS_TRANSIT(){
	var tl = new MTileLayer(TL_MASS_TRANSIT);  //添加轨道交通层
	mapObj.addTileLayer(tl);
}

function addTileLayer_TL_CUSTOM_MAP(){
	var tileLayerOptions=new MTileLayerOptions();
	tileLayerOptions.tileUrl=' http://sisv3.test.mapabc.com/sisserver?config=AUTORENDER&x=[x]&y=[y]&z=[z]&layer=sss&get=map&cache=off&red=off&a_k=86e6ccbc1f8255297f0059a3c9cbafe52b7bfc61aabbbc58d2f24202ad296cc8e929dab2968bb2e0';
	tileLayerOptions.layerId ="layer2";
    var tl = new MTileLayer(TL_CUSTOM_MAP,tileLayerOptions);
	mapObj.addTileLayer(tl);
}